<template>
  <div class="square-list">
    <div class="myvan-image3" v-for="item in listData" :key="item.id">
      <van-image
        :src="item.imgSrc"
        rel="external nofollow"
        class="square-img"
      />
      <p class="introduce">{{item.title}}</p>
      <div class="author-box">
        <div class="avatar">
          <img :src="item.avatar" alt="">
          <div class="author">{{item.author}}</div>
        </div>
        <div class="thumbs-up">
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-shezhi"></use>
          </svg>
          <span>{{item.thumbs}}</span>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'squareList',
  props: {
    listData: Array
  },
  data() {
    return {}
  }
}
</script>
<style lang="scss" scoped>
// 广场
.square-list {
  width: 100%;
  height: 100%;
  display: flex;
  flex-flow: row wrap;
  justify-content: space-between;
  margin-top: 20px;
  .myvan-image3 {
    width: 48%;
    margin-bottom: 10px;
    box-shadow: 0 0 10px rgb(180, 180, 180);
    border-radius: 10px;
    background-color: #fff;
    &:last-of-type {
      margin-bottom: 50px;
    }
    .square-img /deep/ {
      width: 100%;
      height: 130px;
      img {
        width: 100%;
        height: 100%;
        border-radius: 10px;
      }
    }
    .introduce {
      transform: scale(0.9);
      font-size: 10px;
      width: 98%;
      height: $height/2;
      margin: 4px auto;
      text-overflow: -o-ellipsis-lastline;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      -webkit-box-orient: vertical;
    }
    .author-box {
      width: 100%;
      height: $height/2;
      display: flex;
      flex-flow: row nowrap;
      justify-content: space-between;
      padding: 0 6px;
      box-sizing: border-box;
      margin-bottom: $height/10;
      .avatar {
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: left;
        img {
          width: $height/2;
          height: $height/2;
          border-radius: 50%;
        }
        .author {
          transform: scale(0.8);
          font-size: 8px;
        }
      }
      .thumbs-up {
        height: 100%;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        svg {
          font-size: 14px;
        }
        span {
          transform: scale(0.8);
          font-size: 10px;
        }
      }
    }
  }
}
</style>